home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / sbin / gparted < prev    next >
Text File  |  2009-10-06  |  1KB  |  38 lines

  1. #!/bin/sh
  2. #
  3. #  Purpose:  Perform appropriate startup of GParted executable gpartedbin.
  4. #
  5. #            On systems with hal-lock, use hal-lock to acquire device
  6. #            locks prior to running gpartedbin.
  7. #            This is to prevent devices from being automounted.
  8. #            File system problems can occur if devices are mounted
  9. #            prior to the completion of GParted's operations.
  10. #            See GParted bug #324220
  11. #            http://bugzilla.gnome.org/show_bug.cgi?id=324220
  12. #
  13. #            On systems without hal-lock, invoke gpartedbin directly.
  14. #
  15.  
  16. #
  17. #  Search PATH to determine if hal-lock program can be found
  18. #
  19. HAVE_HAL_LOCK=no
  20. for k in '' `echo "$PATH" | sed 's,:, ,g'`; do
  21.     if test -x "$k/hal-lock"; then
  22.         if test "z`ps -e | grep hald`" != "z"; then
  23.             HAVE_HAL_LOCK=yes
  24.             break
  25.         fi
  26.     fi
  27. done
  28.  
  29. #
  30. #  Use hal-lock for invocation if it exists, otherwise simply run gpartedbin
  31. #
  32. if test "x$HAVE_HAL_LOCK" = "xyes"; then
  33.     hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive \
  34.         --run "/usr/sbin/gpartedbin $*"
  35. else
  36.     /usr/sbin/gpartedbin $*
  37. fi
  38.